namespace MVC01.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.Globalization;
    using System.Web.Mvc;
    using System.Web.Security;

    [Bind(Exclude = "CatId")]
    public class Category
    {
        public Category()
        {
            this.ProductCategories = new HashSet<ProductCategory>();
        }
        
        [Key]
        public int CatId { get; set; }
        
        [Display(Name = "Category Name")]
        [StringLength(80, ErrorMessage = "Category Name cannot more than 80 characters")]
        public string CatName { get; set; }

        [Display(Name = "Position")]
        public Nullable<int> Position { get; set; }

        [Display(Name = "Is Active")]
        public Nullable<bool> IsActive { get; set; }

        [Display(Name = "Parent Id")]
        public Nullable<int> ParentId { get; set; }

        [Display(Name = "Image Id")]
        public Nullable<int> ImageId { get; set; }

        public virtual ICollection<ProductCategory> ProductCategories { get; set; }
        public virtual Image Image { get; set; }
    }
}
